<?php

/**
 * @Description    用户所属部门(分中心)
 * @Author         zhaojiping
 * @Copyright      Copyright (c) 山东艾思软件科技有限公司(https://www.aisisofit.cn)
 * @Date           2022/2/7
 * @CreateBy       VS Code
 */

namespace app\core\controller;

use app\core\model\CoreRole;

class RoleController extends \app\common\controller\GeneralController {

    /**
     * 初始化
     */
    public function initialize() {
        parent::initialize();
        $this->model = new CoreRole();
        $this->validate = new \app\core\validate\CoreRole();
    }

    /**
     * 保存授权
     */
    public function editAuth() {
        $role_id = input('role_id/d', 0);
        $data = [
            'rules' => input('rules', '')
        ];
        $this->model->update($data, ['id' => $role_id]);
        json_return(1, "授权成功");
    }
}
